]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
tools: Add rules override for code snippets in docs
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 10 Jun 2025 09:00:52 +0000 (11:00 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 30 Jul 2025 14:27:19 +0000 (14:27 +0000)
The snippets don't have context, so any rules that catch undefined
or unused stuff don't apply.

We currently disable those rules via command-line parameters. Including
it in the config instead will allow to re-use the run-eslint.sh wrapper.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3746>

tools/eslint.config.js

index 82b860911bab1add73787885fa9ef7c721c80467..6c7c3774293a3236c5706aeb577a56d8b6ab3726 100644 (file)
@@ -77,5 +77,13 @@ export default defineConfig([
                 N_: 'readonly',
             },
         },
+    }, {
+        // doc snippets, disable rules that depend on wider context
+        files: ['tmp.*/*.js'],
+        rules:  {
+            'no-undef': 'off',
+            'no-unused-vars': 'off',
+            'no-invalid-this': 'off',
+        },
     },
 ]);